﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Data.SqlClient;

namespace JDML
{
    public class EstablishConnection
    {
        private static SqlConnection conn = null;
        public static SqlConnection getSQLConn()
        {
            if (conn == null)
            {
                string connStr = ConfigurationManager.ConnectionStrings["HotelConnectionString"].ToString();
                conn = new SqlConnection(connStr);
                conn.Open();
            }
            return conn;
        }

        public static SqlConnection getSQLConn2()
        {
            string connStr = ConfigurationManager.ConnectionStrings["HotelManageMentConnectionString"].ToString();
            SqlConnection conn = new SqlConnection(connStr);
            conn.Open();
            return conn;
        }

    }
}
